home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Toolbox
/
Visual Basic Toolbox (P.I.E.)(1996).ISO
/
graphics
/
brush
/
brush.frm
< prev
next >
Wrap
Text File
|
1994-07-14
|
13KB
|
401 lines
VERSION 2.00
Begin Form frmBrush
BackColor = &H00C0C0C0&
BorderStyle = 3 'Fixed Double
Caption = "PatternBrush-Demo"
ClientHeight = 3735
ClientLeft = 1050
ClientTop = 1800
ClientWidth = 7365
DrawStyle = 5 'Transparent
FillStyle = 0 'Solid
Height = 4140
Left = 990
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 3735
ScaleWidth = 7365
Top = 1455
Width = 7485
Begin SSCommand cmdInfo
Font3D = 0 'None
Height = 600
Left = 270
Picture = BRUSH.FRX:0000
TabIndex = 10
Top = 2940
Width = 600
End
Begin CommandButton cmdSave
Caption = "&Save Bitmaps to disk"
Height = 405
Left = 3060
TabIndex = 9
Top = 3120
Width = 2535
End
Begin CommandButton cmdForm
Cancel = -1 'True
Caption = " &Ok"
Default = -1 'True
Height = 405
Index = 0
Left = 5760
TabIndex = 5
Top = 3120
Width = 1365
End
Begin SSPanel panel
Align = 1 'Align Top
Alignment = 0 'Left Justify - TOP
BackColor = &H00C0C0C0&
BevelInner = 2 'Raised
BorderWidth = 1
Font3D = 3 'Inset w/light shading
ForeColor = &H00800000&
Height = 675
Left = 0
Outline = -1 'True
TabIndex = 1
Top = 0
Width = 7365
Begin SSOption opt
Caption = "Brush Panel"
Font3D = 0 'None
Height = 195
Index = 1
Left = 5670
TabIndex = 7
TabStop = 0 'False
Top = 360
Width = 1365
End
Begin SSOption opt
Caption = "Brush Form"
Font3D = 0 'None
Height = 195
Index = 0
Left = 5670
TabIndex = 6
Top = 120
Value = -1 'True
Width = 1365
End
Begin SSRibbon cmd
AutoSize = 0 'None
BackColor = &H00C0C0C0&
Height = 375
Index = 11
Left = 4230
PictureDnChange = 0 'Use 'PictureUp' Bitmap Unchanged
PictureUp = BRUSH.FRX:0302
Top = 150
Width = 375
End
Begin SSRibbon cmd
AutoSize = 0 'None
BackColor = &H00C0C0C0&
Height = 375
Index = 13
Left = 4950
PictureDnChange = 0 'Use 'PictureUp' Bitmap Unchanged
PictureUp = BRUSH.FRX:039C
Top = 150
Width = 375
End
Begin SSRibbon cmd
AutoSize = 0 'None
BackColor = &H00C0C0C0&
Height = 375
Index = 12
Left = 4590
PictureDnChange = 0 'Use 'PictureUp' Bitmap Unchanged
PictureUp = BRUSH.FRX:0436
Top = 150
Width = 375
End
Begin SSRibbon cmd
AutoSize = 0 'None
BackColor = &H00C0C0C0&
Height = 375
Index = 10
Left = 3870
PictureDnChange = 0 'Use 'PictureUp' Bitmap Unchanged
PictureUp = BRUSH.FRX:04D0
Top = 150
Width = 375
End
Begin SSRibbon cmd
AutoSize = 0 'None
BackColor = &H00C0C0C0&
Height = 375
Index = 3
Left = 1260
PictureDnChange = 0 'Use 'PictureUp' Bitmap Unchanged
PictureUp = BRUSH.FRX:056A
Top = 150
Width = 375
End
Begin SSRibbon cmd
AutoSize = 0 'None
BackColor = &H00C0C0C0&
Height = 375
Index = 7
Left = 2700
PictureDnChange = 0 'Use 'PictureUp' Bitmap Unchanged
PictureUp = BRUSH.FRX:0604
Top = 150
Width = 375
End
Begin SSRibbon cmd
AutoSize = 0 'None
BackColor = &H00C0C0C0&
Height = 375
Index = 4
Left = 1620
PictureDnChange = 0 'Use 'PictureUp' Bitmap Unchanged
PictureUp = BRUSH.FRX:069E
Top = 150
Width = 375
End
Begin SSRibbon cmd
AutoSize = 0 'None
BackColor = &H00C0C0C0&
Height = 375
Index = 5
Left = 1980
PictureDnChange = 0 'Use 'PictureUp' Bitmap Unchanged
PictureUp = BRUSH.FRX:0B18
Top = 150
Width = 375
End
Begin SSRibbon cmd
AutoSize = 0 'None
BackColor = &H00C0C0C0&
Height = 375
Index = 2
Left = 900
PictureDnChange = 0 'Use 'PictureUp' Bitmap Unchanged
PictureUp = BRUSH.FRX:0BB2
Top = 150
Width = 375
End
Begin SSRibbon cmd
AutoSize = 0 'None
BackColor = &H00C0C0C0&
Height = 375
Index = 6
Left = 2340
PictureDnChange = 0 'Use 'PictureUp' Bitmap Unchanged
PictureUp = BRUSH.FRX:0C4C
Top = 150
Width = 375
End
Begin SSRibbon cmd
AutoSize = 0 'None
BackColor = &H00C0C0C0&
Height = 375
Index = 1
Left = 540
PictureDnChange = 0 'Use 'PictureUp' Bitmap Unchanged
PictureUp = BRUSH.FRX:0CE6
Top = 150
Width = 375
End
Begin SSRibbon cmd
AutoSize = 0 'None
BackColor = &H00C0C0C0&
Height = 375
Index = 9
Left = 3510
PictureDnChange = 0 'Use 'PictureUp' Bitmap Unchanged
PictureUp = BRUSH.FRX:0D80
Top = 150
Width = 375
End
Begin SSRibbon cmd
AutoSize = 0 'None
BackColor = &H00C0C0C0&
Height = 375
Index = 8
Left = 3150
PictureDnChange = 0 'Use 'PictureUp' Bitmap Unchanged
PictureUp = BRUSH.FRX:0E1A
Top = 150
Width = 375
End
Begin SSRibbon cmd
AutoSize = 0 'None
BackColor = &H00C0C0C0&
Height = 375
Index = 0
Left = 180
PictureDnChange = 0 'Use 'PictureUp' Bitmap Unchanged
PictureUp = BRUSH.FRX:0EB4
Top = 150
Width = 375
End
End
Begin Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "[ Control_Brush control, any.picture, borderwidth% ]"
FontBold = -1 'True
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 12
FontStrikethru = 0 'False
FontUnderline = 0 'False
ForeColor = &H00808080&
Height = 300
Index = 3
Left = 990
TabIndex = 0
Top = 1890
Width = 6195
End
Begin Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "This is all you need to do:"
FontBold = -1 'True
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 12
FontStrikethru = 0 'False
FontUnderline = -1 'True
Height = 300
Left = 180
TabIndex = 2
Top = 930
Width = 3060
End
Begin Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Brush_Form Me, any.picture"
FontBold = -1 'True
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 12
FontStrikethru = 0 'False
FontUnderline = 0 'False
ForeColor = &H00800000&
Height = 300
Index = 0
Left = 990
TabIndex = 3
Top = 1590
Width = 3390
End
Begin Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "sub Form_Paint()"
FontBold = -1 'True
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 12
FontStrikethru = 0 'False
FontUnderline = 0 'False
ForeColor = &H00800000&
Height = 300
Index = 1
Left = 810
TabIndex = 4
Top = 1290
Width = 2085
End
Begin Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "End Sub"
FontBold = -1 'True
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 12
FontStrikethru = 0 'False
FontUnderline = 0 'False
ForeColor = &H00800000&
Height = 300
Index = 2
Left = 810
TabIndex = 8
Top = 2220
Width = 1050
End
End
Dim curFormBMP%, curPanelBMP%
Sub cmd_Click (Index As Integer, Value As Integer)
Dim bmp%
If Value Then bmp = cmd(Index).PictureUp
If opt(0) Then
curFormBMP = bmp
Else
curPanelBMP = bmp
If Value = False Then panel.Refresh
End If
Refresh '-- Calls Form_Paint()
End Sub
Sub cmdForm_Click (Index As Integer)
Unload Me
End Sub
Sub cmdInfo_Click ()
frmInfo.Show 1
End Sub
Sub cmdSave_Click ()
Dim i%, n$
On Error Resume Next
screen.MousePointer = 11
For i = 0 To 13
n = app.Path & "\BRUSH_" & i & ".BMP"
If FileLen(n) Then
screen.MousePointer = 0
MsgBox "Bitmaps already saved!", 48, "Info"
Exit Sub
End If
SavePicture cmd(i).PictureUp, n
If Err Then
screen.MousePointer = 0
MsgBox "Err (#" & Err & ") - Could not save bitmaps!", 48, "Error"
i = 0
Exit Sub
End If
Next
screen.MousePointer = 0
MsgBox "Bitmaps successfully saved to " & app.Path & "\BRUSH_1.BMP - BRUSH13.BMP", 64, "Info"
End Sub
Sub Form_Load ()
frmInfo.Show 1
form_center Me
' Load patterns ( normally not needed )
' -------------------------------------
curFormBMP = cmd(1).PictureUp
curPanelBMP = cmd(3).PictureUp
End Sub
Sub form_paint ()
If opt(0) Then
brush_form Me, curFormBMP
Else
brush_control panel, curPanelBMP, panel.BorderWidth * 4
End If
End Sub
Sub opt_Click (Index As Integer, Value As Integer)
panel.Refresh
Refresh
End Sub